package com.yuchengtech.test.pack.action;

import com.wox.action.JsonData;
import com.wox.action.WoxAction;
import com.yuchengtech.fileUtil.FileUtil;

public class DeleteDirAction extends WoxAction {

	private String packDir;
	
	public void setPackDir(String packDir) {
		this.packDir = packDir;
	}
	@Override
	public String excute() throws Exception {

		JsonData data=this.getJsonData();
		if(packDir!=null&&packDir.trim().length()!=0)
		{
			boolean b=FileUtil.deleteDirFiles(packDir);
			if(b)
			{
			data.setState(true);
			data.setMessage("文件夹及其子文件已删除!");
			}else
				data.setMessage("Sorry(-_-),文件夹删除失败!");
		}else
		data.setMessage("Sorry(-_-),参数有误!");
		return JSONBACK;
	}


}
